import React, { Component } from 'react';


class Boss extends Component {
	constructor(props) {
		super(props)
		this.state = {
			isShow: true,
		}
	}
	render() {
		return (
			<div>
				<div className={this.state.isShow ? 'show': 'hide'}>大魔王孙悟空</div>
				<button onClick={  this.toggle}>切换</button>
			</div>
		)
	}
    toggle = () => {
        console.log('123');
        let { isShow } = this.state
        console.log(isShow)
        this.setState({
			isShow: !isShow
		})
    }
}
 
export default Boss;